Optimal. Leaf size=184 \[ \frac {\left (b^2 e^2 g^2-2 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right ) x}{e^3 g^3}-\frac {c (c e f+c d g-2 b e g) x^2}{2 e^2 g^2}+\frac {c^2 x^3}{3 e g}+\frac {\left (c d^2-b d e+a e^2\right )^2 \log (d+e x)}{e^4 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right )^2 \log (f+g x)}{g^4 (e f-d g)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 184, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.037, Rules used = {907}
\begin {gather*} \frac {x \left (-2 c e g (-a e g+b d g+b e f)+b^2 e^2 g^2+c^2 \left (d^2 g^2+d e f g+e^2 f^2\right )\right )}{e^3 g^3}+\frac {\log (d+e x) \left (a e^2-b d e+c d^2\right )^2}{e^4 (e f-d g)}-\frac {\log (f+g x) \left (a g^2-b f g+c f^2\right )^2}{g^4 (e f-d g)}-\frac {c x^2 (-2 b e g+c d g+c e f)}{2 e^2 g^2}+\frac {c^2 x^3}{3 e g} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 907
Rubi steps
\begin {align*} \int \frac {\left (a+b x+c x^2\right )^2}{(d+e x) (f+g x)} \, dx &=\int \left (\frac {b^2 e^2 g^2-2 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )}{e^3 g^3}-\frac {c (c e f+c d g-2 b e g) x}{e^2 g^2}+\frac {c^2 x^2}{e g}+\frac {\left (c d^2-b d e+a e^2\right )^2}{e^3 (e f-d g) (d+e x)}+\frac {\left (c f^2-b f g+a g^2\right )^2}{g^3 (-e f+d g) (f+g x)}\right ) \, dx\\ &=\frac {\left (b^2 e^2 g^2-2 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right ) x}{e^3 g^3}-\frac {c (c e f+c d g-2 b e g) x^2}{2 e^2 g^2}+\frac {c^2 x^3}{3 e g}+\frac {\left (c d^2-b d e+a e^2\right )^2 \log (d+e x)}{e^4 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right )^2 \log (f+g x)}{g^4 (e f-d g)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 177, normalized size = 0.96 \begin {gather*} -\frac {e g (-e f+d g) x \left (6 b^2 e^2 g^2+6 c e g (2 a e g+b (-2 e f-2 d g+e g x))+c^2 \left (6 d^2 g^2-3 d e g (-2 f+g x)+e^2 \left (6 f^2-3 f g x+2 g^2 x^2\right )\right )\right )-6 \left (c d^2+e (-b d+a e)\right )^2 g^4 \log (d+e x)+6 e^4 \left (c f^2+g (-b f+a g)\right )^2 \log (f+g x)}{6 e^4 g^4 (e f-d g)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 280, normalized size = 1.52
method | result | size |
norman | \(\frac {\left (2 a c \,e^{2} g^{2}+b^{2} e^{2} g^{2}-2 b c d e \,g^{2}-2 b c \,e^{2} f g +c^{2} d^{2} g^{2}+c^{2} d e f g +c^{2} e^{2} f^{2}\right ) x}{e^{3} g^{3}}+\frac {c^{2} x^{3}}{3 e g}+\frac {c \left (2 b e g -d g c -c e f \right ) x^{2}}{2 e^{2} g^{2}}+\frac {\left (a^{2} g^{4}-2 a b f \,g^{3}+2 a c \,f^{2} g^{2}+b^{2} f^{2} g^{2}-2 b c \,f^{3} g +c^{2} f^{4}\right ) \ln \left (g x +f \right )}{g^{4} \left (d g -e f \right )}-\frac {\left (a^{2} e^{4}-2 a b d \,e^{3}+2 a c \,d^{2} e^{2}+b^{2} d^{2} e^{2}-2 b c \,d^{3} e +c^{2} d^{4}\right ) \ln \left (e x +d \right )}{\left (d g -e f \right ) e^{4}}\) | \(262\) |
default | \(\frac {\frac {1}{3} c^{2} x^{3} e^{2} g^{2}+b c \,e^{2} g^{2} x^{2}-\frac {1}{2} c^{2} d e \,g^{2} x^{2}-\frac {1}{2} c^{2} e^{2} f g \,x^{2}+2 a c \,e^{2} g^{2} x +b^{2} e^{2} g^{2} x -2 b c d e \,g^{2} x -2 b c \,e^{2} f g x +c^{2} d^{2} g^{2} x +c^{2} d e f g x +c^{2} e^{2} f^{2} x}{e^{3} g^{3}}+\frac {\left (-a^{2} e^{4}+2 a b d \,e^{3}-2 a c \,d^{2} e^{2}-b^{2} d^{2} e^{2}+2 b c \,d^{3} e -c^{2} d^{4}\right ) \ln \left (e x +d \right )}{e^{4} \left (d g -e f \right )}+\frac {\left (a^{2} g^{4}-2 a b f \,g^{3}+2 a c \,f^{2} g^{2}+b^{2} f^{2} g^{2}-2 b c \,f^{3} g +c^{2} f^{4}\right ) \ln \left (g x +f \right )}{g^{4} \left (d g -e f \right )}\) | \(280\) |
risch | \(\frac {c^{2} x^{3}}{3 e g}+\frac {b c \,x^{2}}{e g}-\frac {c^{2} d \,x^{2}}{2 e^{2} g}-\frac {c^{2} f \,x^{2}}{2 e \,g^{2}}+\frac {2 a c x}{e g}+\frac {b^{2} x}{e g}-\frac {2 b c d x}{e^{2} g}-\frac {2 b c f x}{e \,g^{2}}+\frac {c^{2} d^{2} x}{e^{3} g}+\frac {c^{2} d f x}{e^{2} g^{2}}+\frac {c^{2} f^{2} x}{e \,g^{3}}+\frac {\ln \left (-g x -f \right ) a^{2}}{d g -e f}-\frac {2 \ln \left (-g x -f \right ) a b f}{g \left (d g -e f \right )}+\frac {2 \ln \left (-g x -f \right ) a c \,f^{2}}{g^{2} \left (d g -e f \right )}+\frac {\ln \left (-g x -f \right ) b^{2} f^{2}}{g^{2} \left (d g -e f \right )}-\frac {2 \ln \left (-g x -f \right ) b c \,f^{3}}{g^{3} \left (d g -e f \right )}+\frac {\ln \left (-g x -f \right ) c^{2} f^{4}}{g^{4} \left (d g -e f \right )}-\frac {\ln \left (e x +d \right ) a^{2}}{d g -e f}+\frac {2 \ln \left (e x +d \right ) a b d}{\left (d g -e f \right ) e}-\frac {2 \ln \left (e x +d \right ) a c \,d^{2}}{\left (d g -e f \right ) e^{2}}-\frac {\ln \left (e x +d \right ) b^{2} d^{2}}{\left (d g -e f \right ) e^{2}}+\frac {2 \ln \left (e x +d \right ) b c \,d^{3}}{\left (d g -e f \right ) e^{3}}-\frac {\ln \left (e x +d \right ) c^{2} d^{4}}{\left (d g -e f \right ) e^{4}}\) | \(462\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 253, normalized size = 1.38 \begin {gather*} \frac {{\left (c^{2} f^{4} - 2 \, b c f^{3} g - 2 \, a b f g^{3} + a^{2} g^{4} + {\left (b^{2} + 2 \, a c\right )} f^{2} g^{2}\right )} \log \left (g x + f\right )}{d g^{5} - f g^{4} e} - \frac {{\left (c^{2} d^{4} - 2 \, b c d^{3} e - 2 \, a b d e^{3} + {\left (b^{2} e^{2} + 2 \, a c e^{2}\right )} d^{2} + a^{2} e^{4}\right )} \log \left (x e + d\right )}{d g e^{4} - f e^{5}} + \frac {{\left (2 \, c^{2} g^{2} x^{3} e^{2} - 3 \, {\left (c^{2} f g e^{2} + {\left (c^{2} d e - 2 \, b c e^{2}\right )} g^{2}\right )} x^{2} + 6 \, {\left (c^{2} f^{2} e^{2} + {\left (c^{2} d e - 2 \, b c e^{2}\right )} f g + {\left (c^{2} d^{2} - 2 \, b c d e + b^{2} e^{2} + 2 \, a c e^{2}\right )} g^{2}\right )} x\right )} e^{\left (-3\right )}}{6 \, g^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.38, size = 306, normalized size = 1.66 \begin {gather*} \frac {6 \, c^{2} d^{3} g^{4} x e + 6 \, {\left (c^{2} f^{4} - 2 \, b c f^{3} g - 2 \, a b f g^{3} + a^{2} g^{4} + {\left (b^{2} + 2 \, a c\right )} f^{2} g^{2}\right )} e^{4} \log \left (g x + f\right ) - {\left (2 \, c^{2} f g^{3} x^{3} - 3 \, {\left (c^{2} f^{2} g^{2} - 2 \, b c f g^{3}\right )} x^{2} + 6 \, {\left (c^{2} f^{3} g - 2 \, b c f^{2} g^{2} + {\left (b^{2} + 2 \, a c\right )} f g^{3}\right )} x\right )} e^{4} + 2 \, {\left (c^{2} d g^{4} x^{3} + 3 \, b c d g^{4} x^{2} + 3 \, {\left (b^{2} + 2 \, a c\right )} d g^{4} x\right )} e^{3} - 3 \, {\left (c^{2} d^{2} g^{4} x^{2} + 4 \, b c d^{2} g^{4} x\right )} e^{2} - 6 \, {\left (c^{2} d^{4} g^{4} - 2 \, b c d^{3} g^{4} e - 2 \, a b d g^{4} e^{3} + {\left (b^{2} + 2 \, a c\right )} d^{2} g^{4} e^{2} + a^{2} g^{4} e^{4}\right )} \log \left (x e + d\right )}{6 \, {\left (d g^{5} e^{4} - f g^{4} e^{5}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.77, size = 281, normalized size = 1.53 \begin {gather*} \frac {{\left (c^{2} f^{4} - 2 \, b c f^{3} g + b^{2} f^{2} g^{2} + 2 \, a c f^{2} g^{2} - 2 \, a b f g^{3} + a^{2} g^{4}\right )} \log \left ({\left | g x + f \right |}\right )}{d g^{5} - f g^{4} e} - \frac {{\left (c^{2} d^{4} - 2 \, b c d^{3} e + b^{2} d^{2} e^{2} + 2 \, a c d^{2} e^{2} - 2 \, a b d e^{3} + a^{2} e^{4}\right )} \log \left ({\left | x e + d \right |}\right )}{d g e^{4} - f e^{5}} + \frac {{\left (2 \, c^{2} g^{2} x^{3} e^{2} - 3 \, c^{2} d g^{2} x^{2} e + 6 \, c^{2} d^{2} g^{2} x - 3 \, c^{2} f g x^{2} e^{2} + 6 \, b c g^{2} x^{2} e^{2} + 6 \, c^{2} d f g x e - 12 \, b c d g^{2} x e + 6 \, c^{2} f^{2} x e^{2} - 12 \, b c f g x e^{2} + 6 \, b^{2} g^{2} x e^{2} + 12 \, a c g^{2} x e^{2}\right )} e^{\left (-3\right )}}{6 \, g^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.51, size = 266, normalized size = 1.45 \begin {gather*} x\,\left (\frac {b^2+2\,a\,c}{e\,g}+\frac {\left (\frac {c^2\,\left (d\,g+e\,f\right )}{e^2\,g^2}-\frac {2\,b\,c}{e\,g}\right )\,\left (d\,g+e\,f\right )}{e\,g}-\frac {c^2\,d\,f}{e^2\,g^2}\right )-x^2\,\left (\frac {c^2\,\left (d\,g+e\,f\right )}{2\,e^2\,g^2}-\frac {b\,c}{e\,g}\right )+\frac {\ln \left (d+e\,x\right )\,\left (e^2\,\left (b^2\,d^2+2\,a\,c\,d^2\right )+a^2\,e^4+c^2\,d^4-2\,a\,b\,d\,e^3-2\,b\,c\,d^3\,e\right )}{e^5\,f-d\,e^4\,g}+\frac {\ln \left (f+g\,x\right )\,\left (g^2\,\left (b^2\,f^2+2\,a\,c\,f^2\right )+a^2\,g^4+c^2\,f^4-2\,a\,b\,f\,g^3-2\,b\,c\,f^3\,g\right )}{d\,g^5-e\,f\,g^4}+\frac {c^2\,x^3}{3\,e\,g} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________